package com.wanmait.wanmarecruit.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.wanmait.wanmarecruit.service.TechnologyService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wanmait.wanmarecruit.entity.Technology;
import com.wanmait.wanmarecruit.mapper.TechnologyMapper;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional(rollbackFor = Exception.class)
public class TechnologyServiceImpl extends ServiceImpl<TechnologyMapper, Technology> implements TechnologyService {

    @Resource
    private TechnologyMapper technologyMapper;
    @Override
    public List<Technology> getTecByUser(Integer userId) {
        LambdaQueryWrapper<Technology> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(Technology::getUserId,userId);
        return this.list(queryWrapper);

    }

    @Override
    public Integer insertTec(Technology technology) {
        technologyMapper.insert(technology);
        return technology.getId();
    }
}


